#!/usr/bin/env python3
# coding: utf-8

# Copyright (c) 2020-2024 Huawei Technologies Co., Ltd.
# oec-hardware is licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#     http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE.
# See the Mulan PSL v2 for more details.
# Create: 2025-02-10
# Desc: main test

import traversal_api
import traversal_parameters


def main():
    # 1. 准备测试配置（根据实际需求修改）
    test_parameters = traversal_parameters.test_parameters

    # 2. 发送请求并获取任务ID
    task_id = traversal_api.send_test_request(test_parameters)
    if not task_id:
        print("获取任务ID失败")
    else:
        print(task_id)

    # 3. 轮询结果（示例：简单轮询）
    # task_id = "674924a0a81300007d005076"
    traversal_api.get_test_result(task_id)
    """
    # 4. 测试报告生成 等待后端平台实现此功能
    if result:
        traversal_api.save_results(result)
    else:
        print("测试未完成或结果获取失败")
    """


if __name__ == "__main__":
    main()
